<style>
	@import url("../../../common/css/order.css");
</style>
<template>
	<view class="other_pages">
		<commonHeader :titleName="titleName"></commonHeader>
		<view class="content_main evaluate_content">
			<view class="evaluate_title">
				<view class="evaluate_title_left">给骑手评个分吧～</view>
				<view class="evaluate_title_right">已对骑手匿名</view>
			</view>
			<view class="evaluate_control">
				<!-- <my-issue ref="issue" :score="3" :riderName="riderName" :deliveryD="deliveryD" :headPicValue="avatar" @submit="submit" /> -->
				<my-issue ref="issue" :score="3" :riderName="riderName" :deliveryD="deliveryD"   @submit="submit" />
			</view>
		</view>
	</view>
</template>

<script>
	import commonHeader from '@/components/common-header/common_header_title.vue';
	import myIssue from '@/components/order/myIssue.vue'
	export default {
		components:{
			commonHeader,myIssue
		},
		data() {
			return {
				titleName:'评价',
				riderName:"韩师傅",
				deliveryD:"今天 12:45 送达",
				avatar:'',
				orderId:0
			}
		},
		onLoad(option) {
			console.log(option)
			let that = this
			that.riderName = option.name
			that.deliveryD = option.time
			that.avatar    = option.avatar
			that.orderId   = option.orderId
		},
		methods: {
			submit(val){
				let that = this
				let postJson 	=	{'content':val.textareaValue,'score':val.score,'orderId':that.orderId}
				this.$api.order.saveEvaluate(postJson)
				.then(res => {
					if(res.code == 200){
						this.$commonJs.waitFunction.waitRelaunch(res.msg,'/pages/order/index')
					}else{
						this.$commonJs.showToast.showNoneToast(res.msg)
					}
				})
				.catch(err => {
					this.$commonJs.showToast.showNoneToast(err)
				})
			}
		}
	}
</script>

<style>

</style>
